package com.essence.common.model.parser;

import com.essence.common.model.Packet;
import io.netty.buffer.ByteBuf;

/**
 * @brief 单点遥控
 */
public class CScNaParser extends ByteBufParser {

    @Override
    void parse(Packet packet, ByteBuf buf) {
        int infoAdr = buf.readUnsignedMediumLE();
        byte qb = buf.readByte();
        Packet.DigitalSignals digitalSignals = new Packet.DigitalSignals(infoAdr, qb, 1, null);
        packet.addDigitalSignals(digitalSignals);
    }

    @Override
    int infoObjectLength() {
        return 4;
    }
}
